else if (!strcmp (name, atk_text_attribute_get_name (ATK_TEXT_ATTR_FG_COLOR)))
{
RGB_vals = g_strsplit (value, ",", 3);
- color = g_malloc (sizeof (GdkColor));
- color->red = atoi (RGB_vals[0]);
- color->green = atoi (RGB_vals[1]);
- color->blue = atoi (RGB_vals[2]);
- g_object_set (G_OBJECT (tag), "foreground-gdk", color, NULL);
+ color = g_malloc (sizeof (GdkRGBA));
+ color->red = atoi (RGB_vals[0]) / 65535.0;
+ color->green = atoi (RGB_vals[1]) / 65535.0;
+ color->blue = atoi (RGB_vals[2]) / 65535.0;
+ g_object_set (G_OBJECT (tag), "foreground-rgba", color, NULL);
}
else if (!strcmp (name, atk_text_attribute_get_name (ATK_TEXT_ATTR_STRETCH)))
GParamSpec *pspec,
GValue *value)
{
- /* We need to special case some attributes here */
- if (strcmp (pspec->name, "background-gdk") == 0)
- {
- gboolean is_set;
-
- g_object_get (object, "background-set", &is_set, NULL);
+ gboolean is_set;
+ gchar *is_set_name;
- if (is_set)
- {
- g_value_init (value, G_PARAM_SPEC_VALUE_TYPE (pspec));
+ is_set_name = g_strdup_printf ("%s-set", pspec->name);
- g_object_get_property (object, pspec->name, value);
-
- return TRUE;
- }
-
- return FALSE;
- }
- else if (strcmp (pspec->name, "foreground-gdk") == 0)
+ if (g_object_class_find_property (G_OBJECT_GET_CLASS (object), is_set_name) == NULL)
{
- gboolean is_set;
-
- g_object_get (object, "foreground-set", &is_set, NULL);
-
- if (is_set)
- {
- g_value_init (value, G_PARAM_SPEC_VALUE_TYPE (pspec));
-
- g_object_get_property (object, pspec->name, value);
-
- return TRUE;
- }
-
+ g_free (is_set_name);
return FALSE;
}
else
{
- gboolean is_set;
- gchar *is_set_name;
-
- is_set_name = g_strdup_printf ("%s-set", pspec->name);
+ g_object_get (object, is_set_name, &is_set, NULL);
- if (g_object_class_find_property (G_OBJECT_GET_CLASS (object), is_set_name) == NULL)
- {
- g_free (is_set_name);
- return FALSE;
- }
- else
- {
- g_object_get (object, is_set_name, &is_set, NULL);
-
- if (!is_set)
- {
- g_free (is_set_name);
- return FALSE;
- }
+ if (!is_set)
+ {
+ g_free (is_set_name);
+ return FALSE;
+ }
- g_free (is_set_name);
+ g_free (is_set_name);
- g_value_init (value, G_PARAM_SPEC_VALUE_TYPE (pspec));
+ g_value_init (value, G_PARAM_SPEC_VALUE_TYPE (pspec));
- g_object_get_property (object, pspec->name, value);
+ g_object_get_property (object, pspec->name, value);
- if (g_param_value_defaults (pspec, value))
- {
- g_value_unset (value);
+ if (g_param_value_defaults (pspec, value))
+ {
+ g_value_unset (value);
- return FALSE;
- }
- }
- return TRUE;
+ return FALSE;
+ }
}
+ return TRUE;
}
static void
set_bg_rgba (text_tag, &rgba);
else
g_warning ("Don't know color '%s'", g_value_get_string (value));
-
- g_object_notify (object, "background-gdk");
}
break;
set_fg_rgba (text_tag, &rgba);
else
g_warning ("Don't know color '%s'", g_value_get_string (value));
-
- g_object_notify (object, "foreground-gdk");
}
break;